package com.mdlib.droid.module.user.adapter;

import android.content.res.Resources;
import android.graphics.Color;
import android.widget.LinearLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mdlib.droid.R;
import com.mdlib.droid.model.entity.BuyRecordEntity;
import com.mdlib.droid.util.ShadowDrawable;

import java.util.List;

/**
 * 作者：HQY on 2018/11/5 16:01
 * 邮箱：hqy_xz@126.com
 */

public class BuyRecordAdapter extends BaseQuickAdapter<BuyRecordEntity, BaseViewHolder> {


    public BuyRecordAdapter(List<BuyRecordEntity> data) {
        super(R.layout.item_buy_record, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BuyRecordEntity item) {

        LinearLayout llAll = helper.getView(R.id.ll_buy_all);
        ShadowDrawable.setShadowDrawable(llAll, mContext.getResources().getColor(R.color.white), dpToPx(10),
                Color.parseColor("#99d2dad7"), dpToPx(8), 0, dpToPx(6));



    }

    private int dpToPx(int dp) {
        return (int) (Resources.getSystem().getDisplayMetrics().density * dp + 0.5f);
    }
}
